var r="fruit";r.replace(/fruit/g,"apple");